Imports System.Xml.Serialization

Namespace CanvasDesigner

    Public Class Diagram
        Inherits XEntityModelElementBase

        ''' <summary>Initializes an instance of the <see cref="Diagram" /> class.
        ''' This is the default constructor for this class.</summary>
        Public Sub New()
            MyBase.New("Diagram", EdmxXmlNamespace)
        End Sub

        ''' <summary>Initializes an instance of the <see cref="Diagram" /> class.</summary>
        ''' <param name="other">An <see cref="System.Xml.Linq.XElement"/> object to copy from.</param>
        Public Sub New(ByVal other As XElement)
            MyBase.New(other)
        End Sub

        Private __AssociationConnectors As AssociationConnectorCollection
        Private __EntityTypeShapes As EntityTypeShapeCollection
        Private __InheritanceConnectors As InheritanceConnectorCollection

        <AutoLoad()> _
        <XmlElement("AssociationConnector", GetType(AssociationConnector))> _
        Public ReadOnly Property AssociationConnectors() As AssociationConnectorCollection
            Get
                If (__AssociationConnectors Is Nothing) Then
                    __AssociationConnectors = New EdmxEditor.CanvasDesigner.AssociationConnectorCollection(Me, MyBase.Name.Namespace, "AssociationConnector")
                End If
                Return __AssociationConnectors
            End Get
        End Property

        <AutoLoad()> _
        <XmlElement("EntityTypeShape", GetType(EntityTypeShape))> _
        Public ReadOnly Property EntityTypeShapes() As EntityTypeShapeCollection
            Get
                If (__EntityTypeShapes Is Nothing) Then
                    __EntityTypeShapes = New EdmxEditor.CanvasDesigner.EntityTypeShapeCollection(Me, MyBase.Name.Namespace, "EntityTypeShape")
                End If
                Return __EntityTypeShapes
            End Get
        End Property

        <AutoLoad()> _
        <XmlElement("InheritanceConnector", GetType(InheritanceConnector))> _
        Public ReadOnly Property InheritanceConnectors() As InheritanceConnectorCollection
            Get
                If (__InheritanceConnectors Is Nothing) Then
                    __InheritanceConnectors = New EdmxEditor.CanvasDesigner.InheritanceConnectorCollection(Me, MyBase.Name.Namespace, "InheritanceConnector")
                End If
                Return __InheritanceConnectors
            End Get
        End Property

        <XmlAttribute()> _
        Public Shadows Property Name() As String
            Get
                Return Me.@Name
            End Get
            Set(ByVal value As String)
                Me.@Name = value
            End Set
        End Property

        <XmlAttribute()> _
        Public Property ZoomLevel() As Integer
            Get
                Return Me.@ZoomLevel
            End Get
            Set(ByVal value As Integer)
                Me.@ZoomLevel = value
            End Set
        End Property

        <XmlAttribute()> _
        Public Property ShowGrid() As Boolean
            Get
                Return Me.@ShowGrid
            End Get
            Set(ByVal value As Boolean)
                Me.@ShowGrid = value
            End Set
        End Property

        <XmlAttribute()> _
        Public Property SnapToGrid() As Boolean
            Get
                Return Me.@SnapToGrid
            End Get
            Set(ByVal value As Boolean)
                Me.@SnapToGrid = value
            End Set
        End Property

        <XmlAttribute()> _
        Public Property DisplayType() As Boolean
            Get
                Return Me.@DisplayType
            End Get
            Set(ByVal value As Boolean)
                Me.@DisplayType = value
            End Set
        End Property

    End Class

End Namespace
